home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 42 / Amiga Format AFCD42 (Issue 126, Aug 1999).iso / -serious- / comms / other / slrn / slrn_src / macros / xcomment.sl < prev   
Text File  |  1999-05-14  |  761b  |  28 lines

  1. % This example shows how followup_hook may be used to generate the
  2. % X-Comment-To field associated with fido.* newsgroups.
  3.  
  4. % This variable will hold the followup_custom_headers as defined in the
  5. % .slrnrc file.
  6. variable Default_Followup_Headers;
  7.  
  8. Default_Followup_Headers = get_variable_value ("followup_custom_headers");
  9. define followup_hook ()
  10. {
  11.    variable h;
  12.    variable from;
  13.  
  14.    h = Default_Followup_Headers;
  15.    
  16.    if (0 == strncmp (current_newsgroup, "fido.", 5))
  17.      {
  18.     from = extract_article_header ("Reply-To");
  19.     !if (strlen (from))
  20.       from = extract_article_header ("From");
  21.  
  22.     % It is a fido newsgroup.  Generate X-Comment-To: header
  23.     h = sprintf ("%s\nX-Comment-To: %s", h, from);
  24.      }
  25.  
  26.    set_string_variable ("followup_custom_headers", h);
  27. }
  28.